package com.sline.ThreadCommunication;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo5_Executors {
    public static void main(String[] args) {
        // 创建线程池
        ExecutorService pool = Executors.newFixedThreadPool(2);
        // 将线程放进池子里并执行
        pool.submit(new MyRunable());
        pool.submit(new MyRunable());
        // 关闭线程池
        pool.shutdown();
    }
}
